package com.example.Service;

import com.example.Dao.StudentDao;
import com.example.Entity.StudentEntity;

import java.util.ArrayList;

/**
 * @version: java version 23
 * @Author: 韩学新
 * @description:
 * @date: 2025-05-17 下午5:42
 */
public class StudentService {

    private StudentDao studentDao = new StudentDao();

    public ArrayList<StudentEntity> getAllStudents() {
        ArrayList<StudentEntity> allStudent = studentDao.getAllStudent();
        for (StudentEntity studentEntity : allStudent) {
            System.out.println(studentEntity);
        }
        return allStudent;
    }


    public void updateStudent(Long id, String name) {
        int result = studentDao.updateStudent(id,name);
        System.out.println(result);
    }


    public static void main() {
        StudentService studentService = new StudentService();
        studentService.updateStudent(1L,"huawei");

    }

}
